<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no">  
    <meta name = "format-detection" content = "telephone=no"> 
    <title>支付</title>
    <link rel="stylesheet" href="__PUBLIC__/Home/css/memberOrder.css">
    <style>
        html,body{
            height: 100%;
            background: white;
        }
    </style>
    <include file="Public/common_js"/>
    <script>
        window.localStorage.setItem('isThrough',null);
    </script>
</head>
<body>
    <input type="hidden" id="time_date" value="{$time}">
    <div class="warp">
        <div class="count-down">
            <h4>剩余支付时间</h4>
            <div class="count-time"><span class="hour_show"></span>:<span class="minute_show"></span>:<span class="second_show"></span></div>
            <div class="refund-mes-title">
                应付金额：
                <span>￥{$order_data['total_amount']}</span>
            </div>
        </div>
        <div class="payment-line"></div>
        <!-- 支付方式 -->
        <div class="pay-method">
            <h3>支付方式</h3>
            <ul id="payment">
                <li data-type="1"><img src="__PUBLIC__/Home/images/wx-pay.png" alt=""><span>微信支付</span></li>
                <!--<li data-type="2"><img src="__PUBLIC__/Home/images/yzf-pay.png" alt=""><span>翼支付</span></li>
                <li data-type="3"><img src="__PUBLIC__/Home/images/kq-pay.png" alt=""><span>块钱支付</span></li>-->
                <!--<li data-type="4"><img src="__PUBLIC__/Home/images/yijifu-pay.png" alt=""><span>易极付</span></li>-->
            </ul>
        </div>
        <div class="pay-but">
            <p class="mgTop"><a href="javascript:void(0) " onclick="_click()" class="btn btn-red btn-block">立即支付</a></p>
        </div>
       </div>
    <php>
        if($type){
        $wx_url = U('Member/doPayOrder',['order_id' => $order_id,'type' => 1]);
        }else{
        $wx_url = U('Member/doPayOrder',['order_id' => $order_id]);
        }
    </php>

    <script type="text/javascript">
		require(['memberPayment']);

        function _click(){
            var payment;
            var flag = false;
            var dtype = 0;
            $('#payment li').each(function(i, o){
                //查找class中是否有active
                if($(this).hasClass("active")){
                    flag = true;
                    //dtype = $(this).attr("data-type");
                    dtype = $(this).data("type");
                }
            });
            //alert(dtype);
            if(!flag){
                alert('请选择支付方式！');
                return;
            }

            switch (dtype){
                //微信
                case 1 : window.location.href="{$wx_url}?pay_id=1";return;
                //翼支付
                //case '2' : window.location.href="{:U('Pay/weixinpay'),['id' => $order_data['order_num']]}";break;
                //块钱支付
                //case '3' : window.location.href="{:U('Pay/weixinpay'),['id' => $order_data['order_num']]}";break;
                //易极付
                case 4 : window.location.href="{$wx_url}?pay_id=4";break;
                default : alert('无效支付！');return;
            }


        }
	</script>
</body>
</html>